package woaini.wind.config.gitlab;

import lombok.RequiredArgsConstructor;
import org.gitlab4j.api.GitLabApi;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@EnableConfigurationProperties(GltLabConfig.class)
@Configuration
@RequiredArgsConstructor
public class GitLabAutoConfig {

  private final GltLabConfig gltLabConfig;

  @Bean
  public GitLabApi gitLabApi() {
    return new GitLabApi(gltLabConfig.getHost(), gltLabConfig.getApiKey());
  }

}
